#  展示nusc数据集  (官方演示  展示图像标签效果)

from nuscenes.nuscenes import NuScenes
import os

# nuscenes 存放路径
nuscenes_data = "E:\\data\\3DpointCloud\\nuscenes\\nuscenes_mini"
nusc = NuScenes(version="v1.0-mini", dataroot=nuscenes_data, verbose=True)



my_sample = nusc.sample[87]
sample_data_token = my_sample['data']['LIDAR_TOP']
print(sample_data_token)
my_predictions_bin_file = os.path.join('E:\\data\\3DpointCloud\\nuscenes\\nuscenes_mini\\lidarseg\\v1.0-mini', sample_data_token + '_lidarseg.bin')

nusc.render_pointcloud_in_image(my_sample['token'],
                                pointsensor_channel='LIDAR_TOP',
                                camera_channel='CAM_BACK',
                                render_intensity=False,
                                show_lidarseg=True,
                                filter_lidarseg_labels=[22, 23],
                                show_lidarseg_legend=True,
                                lidarseg_preds_bin_path=my_predictions_bin_file)

